package com.fortune.dao;

import com.fortune.entity.PhoneAndPassword;
import com.fortune.vo.driver.DriverPersonalInfo;
import com.fortune.vo.salesMan.LoginSalesManInfo;
import org.apache.ibatis.annotations.Param;

public interface DriverDao {
    /**
     * 验证当前账号是否存在
     * @param phone
     * @return
     */
    PhoneAndPassword findPhoneAndPassword(@Param("phone") String phone);

    /**
     * 查询登录成功返回信息
     * @param phone
     * @return
     */
    LoginSalesManInfo findLoginSalesManInfo(@Param("phone") String phone);

    /**
     * 修改密码
     * @param phone
     * @param password
     * @return
     */
    int editPasswordByPhoneAndCode(@Param("phone") String phone,
                                   @Param("password") String password);

    /**
     *
     * @param did
     * @param userId
     * @return
     */
    DriverPersonalInfo findDriverPersonalInfo(@Param("did") String did,
                                              @Param("userId") String userId);

    /**
     * 修改司机姓名
     * @param mid
     * @param did
     * @param userId
     * @return
     */
    int editDriverName(@Param("did") String did,
                       @Param("userId") String userId,
                       @Param("name") String name);

    /**
     * 修改司机手机号
     * @param did
     * @param userId
     * @param newPhone
     * @return
     */
    int editDriverPhone(@Param("did") String did,
                        @Param("userId") String userId,
                        @Param("newPhone") String newPhone);

    /**
     * 验证当前登陆账号是否为司机
     * @param phone
     * @return
     */
    String findPostByPhone(@Param("phone") String phone);

    /**
     * 修改密码
     * @param did
     * @param userId
     * @return
     */
    int editNewPSW(@Param("did") String did,
                   @Param("userId") String userId,
                   @Param("newPassword") String newPassword);
}
